FlyTalk.views.ModeSelection = Ext.extend(Ext.Panel, {
	fullscreen: true,
	layout: 'vbox',
	bodyStyle: 'background-image: url(./images/background.png); width: 100%; height: 100%; position: absolute; top: 0; left: 0',
	
    initComponent: function () {
    	// back button on toolbar
		this.backButton = new Ext.Button({
			text: 'Back',
			ui: 'back',
			handler: this.backButtonTap,
			scope: this
		});
		
    	this.partFncButton = new Ext.Button({
    		text: 'Participant 1',
			ui: 'action',
			width: 250,
			height: 50,
			handler: this.partFncButtonTap,
			scope: this
        });
    	
    	this.uxFncButton = new Ext.Button({
    		text: 'Researcher 1',
			ui: 'light',
			width: 250,
			height: 50,
			handler: this.uxFncButtonTap,
			scope: this
        });
    	
    	this.partLargeButton = new Ext.Button({
    		text: 'Participant 2',
			ui: 'action',
			width: 250,
			height: 50,
			handler: this.partLargeButtonTap,
			scope: this
        });
    	
    	this.uxLargeButton = new Ext.Button({
    		text: 'Researcher 2',
			ui: 'light',
			width: 250,
			height: 50,
			handler: this.uxLargeButtonTap,
			scope: this
        });
    	
    	 this.composeButton = new Ext.Button({
             iconCls: 'compose',
 			 iconMask: true,
             handler: this.onCompose,
             scope: this
         });
    	 
		this.toolbar = new Ext.Toolbar({
			title: 'Mode Selection',
			doc: 'top',
			layout: 'hbox',
			items: [
			//    this.backButton,
				{xtype: 'spacer'},
				//this.composeButton,
			]
		});
		
		this.dockedItems = [this.toolbar];
		this.items = [
		              this.partFncButton, 
		              this.uxFncButton,
		              this.partLargeButton, 
		              this.uxLargeButton
		              ];
		
		FlyTalk.views.ModeSelection.superclass.initComponent.call(this);
        
    },
    
    onCompose1: function (record, index) {
    	Ext.dispatch({
    		controller: FlyTalk.controllers.dbController,
            action: 'getFollowStatus',
            method: 'getFlightPost',
            next: FlyTalk.views.TalkView,
            list: FlyTalk.views.ColumnView.tweetList,
        });
    },
    
    backButtonTap: function () {
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },
    
    onCompose: function (record, index) {
    	 Ext.dispatch({
             controller: FlyTalk.controllers.ftController,
             action: 'openQuestion'
         });
    },
    
	partFncButtonTap: function () { // participant view
		FlyTalk.views.MapView.items.first().hide();
		FlyTalk.views.ComposeView.items.first().hide();
		FlyTalk.views.QuestionForm.items.first().hide();
		FlyTalk.views.BoredView.opened.title = "flytalk"; // set name for database
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },

    uxFncButtonTap: function () { // researcher view
        FlyTalk.views.BoredView.opened.title = "flytalk"; // set name for database
        FlyTalk.views.mainView.timebar.update('<center><div style="padding-top: 5px;font-size: small">researcher ONE</div></center>');
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },
    
    
	partLargeButtonTap: function () { // participant view
		FlyTalk.views.BoredView.opened.title = "flytalk1"; // set name for database
		FlyTalk.views.MapView.items.first().hide();
		FlyTalk.views.ComposeView.items.first().hide();
		FlyTalk.views.QuestionForm.items.first().hide();
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },

    uxLargeButtonTap: function () { // researcher view
    	FlyTalk.views.BoredView.opened.title = "flytalk1"; // set name for database
    	FlyTalk.views.mainView.timebar.update('<center><div style="padding-top: 5px;font-size: small">researcher TWO</div></center>');
    	
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },

});